﻿using MiniFox.Resources;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace Sys.Core.Models.Dto
{
    public class ModuleActionDto
    {
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [JsonProperty("moduleId")]
        public string ModuleID { get; set; }

        [JsonProperty("actionId")]
        [Key]
        public string? ActionID { get; set; }

        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [StringLength(30, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [JsonProperty("actionName")]
        public string ActionName { get; set; }

        [StringLength(200, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [JsonProperty("uri")]
        public string Uri { get; set; }
    }
}
